﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using Xceed.Wpf.Toolkit;

namespace InteControlSys.Converters
{
    public class BoolToWindowStateConverter:IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            bool flag = (bool)value;
            return flag ? WindowState.Open : WindowState.Closed;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            WindowState ws = (WindowState)value;
            return ws == WindowState.Open ? true : false;
        }
    }
}
